package com.awesome.uidemo.label;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.ViewStub;

import com.awesome.common.util.log.ShowLogUtil;
import com.awesome.uidemo.R;

/**
 * 标签页面
 */
public class LabelActivity extends AppCompatActivity {
    boolean isVisible = false;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_label);
        ViewStub viewStub = findViewById(R.id.view_stub);
        // 显示或隐藏<ViewStab/>;
        findViewById(R.id.btn_controll).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ShowLogUtil.info(viewStub.getVisibility());
                if (isVisible){
                    viewStub.setVisibility(View.GONE);
                }else {
                    viewStub.setVisibility(View.VISIBLE);
                }
                isVisible = !isVisible;
            }
        });
    }
}